package com.dev.security;

import com.dev.security.interceptor.LogInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * #Author:槐序二四
 * #Time：2020/4/15 16:27
 * #Motto:人间荒唐市侩 不如山中作怪🌙.
 */

public class SecurityWebConfigurer implements WebMvcConfigurer {

    @Autowired
    LogInterceptor logInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(logInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/**/*.json","/**/*.css","/**/*.jpg","/**/*.js","/**/*.html","/**/*.png");

    }
}
